Repository navigation
Conversation
A per-product line with %command% where the game goes, as Steam takes it, for native programs that belong beside one game: a TSM AppImage behind a systemd unit, which neither Game Tools (Windows programs) nor game-performance (it wraps Battle.net, which outlives the game) can start and stop. A game Lightforge starts is wrapped for real, outside game-performance. One Battle.net starts cannot be, so there the line runs once the game is up and %command% waits for it to exit: a script that starts helpers, runs "$@" and cleans up after works for both. lightforge play honours the line too, as it does every other per-product setting.
One field per game, saved once typing pauses as the environment editor is. A hand-off runs the line beside the game once it is in the process table, and the field says so, since a wrapper there has nothing around it to wrap.
Member
|
Hey, sounds good and i will check it when i am at home |
Member
|
Thanks, this is really well done. Merged into dev (rebased onto the launch changes there), with a small hint added that %command% has to stay in the foreground. It'll be in the next release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a per-game Launch options field to Game Settings. It works like Steam's: a command line with
%command%where the game goes. Use it to run host programs around a game, such as a helper app that should run only while WoW does, without a watcher script polling for the game.How it runs
lightforge play): the options wrap the game, outermost as on Steam. The order is: the options, thengame-performance, then Proton.%command%becomes"$@", sosh -cgets the game's command as arguments and never parses it.%command%waits for the game to exit (tail --pid). A script that does things before and after%command%behaves the same in both cases.%command%does nothing, and the field says so. Steam would add such a line to the game's arguments, but a Battle.net launch can't take arguments.shon the host, not in the prefix. Nothing touches the game.In the Battle.net case, the line runs in its own process group, so its cleanup still runs after a Ctrl+C in the launcher's terminal. Its stderr is drained so a program that prints a lot isn't killed by SIGPIPE. If the line fails, the first 4 KiB of stderr go to the log.
Each game's line is saved as
launch_optionsinconfig.toml. It's left out when empty, so existing configs save unchanged.Testing
cargo testpasses (1021 tests),cargo clippy --all-targetsreports nothing, anddocs/CLI.mdis unchanged because there are no new flags.crates/core/src/launch_options.rscheck that:%command%runs nothing$HOME, quotes and a literal%command%%command%waits for the game to exitsystemctl --user start tsm.service; %command%; sleep 30; …started TSM with the game and stopped it a 30 seconds after the game exitedNot covered by automated tests: whether a Battle.net launch picks up the right game's line (that needs a running client), and
lightforge playend to end (that needs an install).